package com.evan.designpatterns.observer.gperadvice;

import java.util.Observable;

/**
 * @author :liujiapeng01
 * @date :2019-03-19 15:44
 **/
public class Gper extends Observable {

    private String name = "Gper生态圈";
    private static Gper Gper = null;
    private Gper(){}

    public static Gper getInstance(){
        if(null == Gper){
            Gper = new Gper();
        }
        return Gper;
    }

    public String getName() {
        return name;
    }

    public void publishQuestion(Question question){
        System.out.println(question.getUserName() + "在" + this.name + "上提交了一个问题。");
        setChanged();
        notifyObservers(question);
    }
}
